Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@arcblock/did-auth-storage
Advanced tools
Interface for define a storage class that can be used by [@arcblock/did-auth].
Since tokens are used everywhere make achieve better QR code experience, we should allow users to customize how to generate/store/update token records.
Basic APIs that a token storage should support:
async init()
, optional, should be called before creating any instance, open a database connection, creating a embed database on file systemasync create(token, status = created)
, create a new token record, persist in data storeasync exist?(token, did)
, check for token existenseasync read(token)
, read a token from database,async update(token, updates)
, update token recordasync delete(token)
, remove a token recordasync gc()
, optional, run garbage collection on the token storagePlan to support:
npm install @arcblock/did-auth-storage
// or
yarn add @arcblock/did-auth-storage
const StorageInterface = require('@arcblock/did-auth-storage');
const keystone = require('keystone');
module.exports = class KeystoneStorage extends StorageInterface {
constructor() {
this.model = keystone.list('LoginToken').model;
}
create(token, status = 'created') {
const LoginToken = this.model;
const item = new LoginToken({ token, status });
return item.save();
}
read(token) {
return this.model.findOne({ token });
}
update(token, updates) {
return this.model.findOneAndUpdate({ token }, updates);
}
delete(token) {
return this.model.remove({ token });
}
exist(token, did) {
return this.model.findOne({ token, did });
}
};
Name | Website |
---|---|
wangshijun | https://ocap.arcblock.io |
FAQs
Storage interface for did-auth
The npm package @arcblock/did-auth-storage receives a total of 376 weekly downloads. As such, @arcblock/did-auth-storage popularity was classified as not popular.
We found that @arcblock/did-auth-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.